/***************
 * Home Alerts Panel
 */
AIR2.Home.Alerts = function() {
    var hide = (AIR2.Home.ALERTDATA.radix.length == 0) ? true : false;
    return new AIR2.UI.Panel({
        colspan: 2,
        title: 'Alerts',
        cls: 'air2-home-alert',
        iconCls: 'air2-icon-alert',
        showTotal: true,
        storeData: AIR2.Home.ALERTDATA,
        itemSelector: '.air2-home-alert-row',
        collapsed: hide,
        tpl: new Ext.XTemplate(
            '<table>' +
              '<tr><td>TYPE</td><td>USER</td><td>ACTION</td><td>DATE</td></tr>' +
              '<tpl for=".">' +
              '<tr class="air2-home-alert-row">' +
                '<td>{[AIR2.Format.tankType(values)]}<b>Import:</b> {[AIR2.Format.tankName(values)]}</td>' +
                '<td>{[AIR2.Format.userName(values.User,true)]}' +
                '<td><a href="{[this.getLink(values)]}">Resolve Conflicts</a></td>' +
                '<td>{[AIR2.Format.date(values.tank_dtim)]}</td>' +
              '</tr>' +
            '</tpl></table>',
            {
                compiled: true,
                disableFormats: true,
                getLink: function(values) {
                    return AIR2.HOMEURL+'/import/'+values.tank_uuid;
                }
            }
        )
    });
}